const { DataTypes } = require('sequelize');
const { sequelize } = require('../config/database');

const User = sequelize.define('User', {
  username: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: true,
    comment: '用户名'
  },
  password: {
    type: DataTypes.STRING,
    allowNull: false,
    comment: '加密密码'
  },
  nickname: {
    type: DataTypes.STRING,
    allowNull: true,
    comment: '昵称'
  },
  mobile: {
    type: DataTypes.STRING,
    allowNull: true,
    unique: true,
    comment: '手机号'
  }
}, {
  tableName: 'users',
  timestamps: true
});

module.exports = User; 